﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

using NUnit.Framework ;


namespace UnitTestProject.Pilot
{
    [TestFixture]
    public class CDDataManipulationTest
    {
        string m_XmlString = 
@"<usage>
    <![CDATA[1234567]]>
  </usage>";

        XElement m_ElementUsage = null;
        [SetUp]
        public void TestSetup()
        {
            m_ElementUsage= XElement.Parse(m_XmlString);
        }

        [Test]
        public void GetUsageContent()
        {
            Assert.AreEqual("1234567",m_ElementUsage.Value) ;
        }

        [Test]
        public void UpdateUsageContent()
        {
            string newUsage = "0123";
            m_ElementUsage.ReplaceNodes(new XCData(newUsage));
            Assert.AreEqual(newUsage, m_ElementUsage.Value);

        }
    }
}
